using System;
using System.Collections.Generic;
using System.Text;
using QLNT_DTO;
using System.Data;

namespace QLNT_DAO
{
    public class XuatXu_dao
    {
        public XuatXu_dto[] SelectAll()
        {
            XuatXu_dto[] x = new XuatXu_dto[100];
            DataTable dt = new DataTable();
            try
            {
                dt = MyExecute.ExecuteQuery("sp_LayDSLoaiThuoc");
                int n = dt.Rows.Count;
                x = new XuatXu_dto[n];
                for (int i = 0; i < n; i++)
                {
                    x[i] = new XuatXu_dto();
                    x[i].MaXuatXu = int.Parse(dt.Rows[i]["MaXuatXu"].ToString());
                    x[i].TenXuatXu = dt.Rows[i]["TenXuatXu"].ToString();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return x;
        }
    }
}
